package com.scrx.ymg.dao.agent;

import java.util.List;
import java.util.Map;

import org.springframework.web.multipart.MultipartFile;

import com.scrx.ymg.entity.AgentHot;
import com.scrx.ymg.entity.AgentInfo;
import com.scrx.ymg.entity.AgentMoney;
import com.scrx.ymg.entity.BankAccount;
import com.scrx.ymg.entity.HeadWithdarw;
import com.scrx.ymg.entity.OtherInfo;
import com.scrx.ymg.entity.OtherMoney;
import com.scrx.ymg.entity.SuperMarketEntrepot;
import com.scrx.ymg.entity.SuperMarketInfo;
import com.scrx.ymg.entity.UserComplain;

public interface IAgentInfoDao {
   
	 
	/**
	 * 根据代理商id查询代理商信息
	 * @return
	 */
	public AgentInfo getAgentInfoByID(int agentID);
	
	/**
	 * 根据代理商所属区域编号查询代理商信息
	 * @return
	 */
	public AgentInfo getAgentInfoByagentRegion(String agentRegion);
	
	/**
	 * 更新代理商信息
	 * @return
	 */
	public String updateAgentInfo(AgentInfo info);
    
	/**
	 * 添加爆款
	 * @param hot
	 * @return
	 */
	public String saveAgentHot(AgentHot hot);
	
	/**
	 * 根据爆款id查询爆款
	 * @param hot
	 * @return
	 */
	public AgentHot selectAgentHot(int hotId);
	
	/**
	 * 查询爆款集合
	 * @param hot
	 * @return
	 */
	public Map<Object, Object> selectAgentHot(AgentHot hot,int pageNum,int pageCount);
	
	/**
	 * 删除爆款
	 * @param hot
	 * @return
	 */
	public String delectAgentHot(AgentHot hot);
	
	/**
	 * 添加爆款
	 * @param head
	 * @param Thumbnail
	 * @param ThumbnailPath
	 * @param banner
	 * @param bannerPath
	 * @return
	 */
	public String saveAgentHot(AgentHot hot, MultipartFile Thumbnail, String ThumbnailPath,
			MultipartFile banner, String bannerPath,MultipartFile hotDetailFile,String hotDetailFilePath,
			MultipartFile bigpicFile,String bigpicPaht);
	
	/**
	 * 判断是否超市名称是否存在
	 * @param superName
	 * @return
	 */
	public SuperMarketInfo superNameExists(String superName);
	
	/**
	 * 判断超市账号是否存在
	 * @param account
	 * @return
	 */
	public SuperMarketInfo accountExists(String account);
	
	
	/**
	 * 得到超市集合
	 * @param account
	 * @return
	 */
	public Map<Object, Object> getSuperMarketInfoList(SuperMarketInfo info,int pageNum,int pageCount);
     
	/**
	 * 更新爆款
	 * @param hot
	 * @param thumbnail
	 * @param thumbnailPath
	 * @param banner
	 * @param bannerPath
	 * @return
	 */
	public String updateAgentHot(AgentHot hot, MultipartFile thumbnail, String thumbnailPath, MultipartFile banner,
			String bannerPath,MultipartFile hotDetailFile,String hotDetailFilePath,MultipartFile bigpicFile,String bigpicFilePath);
    
	/**
	 * 得到代理商营业额
	 * @param agentId
	 * @return
	 */
	public AgentMoney getAgentMoneyInfo(int agentId);
    
	/**
	 * 代理商查询投诉
	 * @param complain
	 * @param pageNum
	 * @param pageCount
	 * @return
	 */
	public Map<Object, Object> getUserComplaint(UserComplain complain,String startTime,String endTime, int pageNum, int pageCount);
	
	/**
     * 查询单个爆款
     * @param hotId
     * @return
     */
	public AgentHot getHotProduct(int hotId);
     
	/**
	 * 代理商统计超市集合
	 * @param info
	 * @param pageNum
	 * @param pageCount
	 * @return
	 */
	public Map<Object, Object> statisticsSuperMarketInfo(SuperMarketInfo info, int pageNum, int pageCount);
	
	/**
	 * 更新爆款
	 * @param hot
	 * @return
	 */
	public String updateAgentHot(AgentHot hot);
    
	/**
	 * 新增代理商
	 * @param info
	 * @return
	 */
	public String addAgentInfo(AgentInfo info,AgentMoney money);
	
     /**
      * 查询代理商
      * @param info
      * @param pageNum
      * @param pageCount
      * @return
      */
	public Map<Object, Object> selectAgentInfoList(AgentInfo info, int pageNum, int pageCount);
    
	/**
	 * 总部查询爆款
	 * @param hot
	 * @param pageNum
	 * @param pageCount
	 * @return
	 */
	public Map<Object, Object> selectAgentHotHead(AgentHot hot, int pageNum, int pageCount);
    
	
	
	/**
	 * 查询提现设置
	 * @return
	 */
	public HeadWithdarw selectHeadWithdarw();
    
	
	/**
	 * 更新提现设置
	 * @param head
	 * @return
	 */
	public String updateHeadWithdarw(HeadWithdarw head);
    
	/**
	 * 是否存在异业商家
	 * @param info
	 * @return
	 */
	public OtherInfo OtherInfoExists(OtherInfo info);
    
	/**
	 * 新建异业商家
	 * @param oldinfo
	 * @param sjsj
	 * @param liveActionPath
	 * @param yyzz
	 * @param licensePath
	 * @param htxy
	 * @param deliverPath
	 * @param card
	 * @param cardPath
	 * @return
	 */
	public String createOtherInfo(OtherInfo oldinfo, MultipartFile sjsj, String liveActionPath, MultipartFile yyzz,
			String licensePath, MultipartFile htxy, String deliverPath, MultipartFile card, String cardPath,OtherMoney money);
    
	/**
	 * 根据代理id得到超市集合
	 * @param agentId
	 * @return
	 */
	public List<SuperMarketInfo> getListSuper(Integer agentId);
    /**
     * 更新爆款,添加超市爆款
     * @param agentHot
     * @param entreList
     * @return
     */
	public String updateAgentHotAndSuperEntrepot(AgentHot agentHot, List<SuperMarketEntrepot> entreList);
    
	/**
	 * 判断代理商账号是否存在
	 * @param account
	 * @return
	 */
	public AgentInfo getAgentInfoBytAccount(String account);
    
	/**
	 * 根据邮编和状态查询
	 * @param agentRegion
	 * @return
	 */
	public AgentInfo getAgentInfoByagentRegionAndStatus(String agentRegion);
    
	/**
	 * 恢复代理商
	 * @param info
	 * @param bank
	 * @return
	 */
	public String updateAgentInfo(AgentInfo info, BankAccount bank);
    
	/**
	 * 恢复代理商新建微信账号
	 * @param info
	 * @param bank
	 * @return
	 */
	public String updateAgentInfoSaveBank(AgentInfo info, BankAccount bank);
    
	/**
	 * 更新代理商和超市爆款上下架
	 * @param hot
	 * @return
	 */
	public String updateAgentHotAndSuperEntrepot(AgentHot hot);
	
	/**
	 * 根据代理商id查询所属爆款集合
	 * @param agentId
	 * @return
	 */
	public List<AgentHot> getAgentHotsByAgentId(int agentId);
	
}
